function dataCat = assessEmotionDataCategorical(data)

emotions = {'Angry','Scared','Sad','Calm','Happy','Excited','Centre','Elsewhere'};

% Allocate the mouse pointer to each of the emotions over the timeseries
for i = 1:length(emotions)-1
  [prop(i),dataCat(:,i)] = checkEmo(emotions{i},data);
end

dataCat = dataCat .* repmat([1:7]', 1, length(data))';
dataCat = sum(dataCat,2);





function [proportion,truevals] = checkEmo(emo,data)

% Get where the emotions are located
[emoPosX,emoPosY, val] = readEmotionPos(emo);
% Check the pointer location
dataTrue(:,1) = (data(:,1) > emoPosX(1)) & (data(:,1) < emoPosX(2));
dataTrue(:,2) = (data(:,2) > emoPosY(1)) & (data(:,2) < emoPosY(2));
% If both are there then it is true
truevals = (dataTrue(:,1) + dataTrue(:,2)) == 2;
% Proportion true to false
proportion = length(find(truevals));

